#!/usr/bin/env python3
import os

count = 0

def dirSizeCount(path):
    global count
    fileList = os.listdir(path)
    for T in fileList:
        tmp = os.path.join(path,T)
        if os.path.isfile(tmp):
            count += os.path.getsize(tmp)
        elif os.path.isdir(tmp):
            dirSizeCount(tmp)
        else:
            print('do nothing')


#test
dirSizeCount("./")

print("testpath size is:" + str(count))
